package Gamefield;

import Pieces.Piece;

public class Field implements Cloneable{
	private Piece _piece;

	public Piece getPiece() {
		return _piece;
	}

	public void setPiece(Piece p) {
		this._piece = p;
	}

	public Field(Piece fig){
		_piece = fig;
	}
	
	public Field(){
		_piece = null;
	}
	
	public Field(Field copy) {
		if (copy.getPiece() != null){
			this._piece = new Piece(copy.getPiece());
		}
	}

	public String toString(){
		if (_piece == null){
			return " ";
		} else {
			return _piece.toString();
		}
	}
	
	public Object clone(){
		Field f = null;
		try{
			f = (Field) super.clone();
		} catch(CloneNotSupportedException e){
			System.out.println("Field CLONE ERROR");
		}
		return f;
	}
}
